import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/solution',
    name: 'solution',
    component: () => import('../views/Solution.vue'),
    redirect: '/solution/daba',
    children: [
      {
        path: 'daba',
        name: 'daba',
        component: () => import('../views/DaBa.vue'),
      },
      {
        path: 'chuzu',
        name: 'chuzu',
        component: () => import('../views/ChuZu.vue'),
      },
      {
        path: 'weigongjiao',
        name: 'weigongjiao',
        component: () => import('../views/WeiGongJiao.vue'),
      },
      {
        path: 'xiaoqu',
        name: 'xiaoqu',
        component: () => import('../views/XiaoQu.vue'),
      },
      {
        path: 'qishiye',
        name: 'qishiye',
        component: () => import('../views/QiShiYe.vue'),
      },
      {
        path: 'weiketing',
        name: 'weiketing',
        component: () => import('../views/WeiKeTing.vue'),
      },
      {
        path: 'cheku',
        name: 'cheku',
        component: () => import('../views/CheKu.vue'),
      },
      {
        path: 'zonghe',
        name: 'zonghe',
        component: () => import('../views/ZongHe.vue'),
      },
      {
        path: 'kuaichongzhan',
        name: 'kuaichongzhan',
        component: () => import('../views/KuaiChongZhan.vue'),
      },
      {
        path: 'gengxin',
        name: 'gengxin',
        component: () => import('../views/GengXin.vue'),
      },
    ],
  },
  {
    path: '/',
    name: 'home',
    component: HomeView
  },
  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
